<template>
    <!-- 头部搜索框 start -->
    <nav class="nav-box">
        <div class="nav-input">
            <input type="text" @blur="isShow=false" @focus="isShow=true">
        </div>
        <div class="nav-btn" v-show="isShow">
            <span>搜索</span>
        </div>
    </nav>
    <!-- 头部搜索框 end -->
</template>

<script>
export default {
    data() {
        return {
            isShow: false
        }
    },
}
</script>

<style>
.nav-box {
    height: 1rem;
    line-height: 1rem;
    background-color: #fff;
    border-bottom: 1px solid #cccccc;
    display: flex;
    flex-flow: row nowrap;
    justify-content: center;
    box-sizing: border-box;
}

.nav-box>.nav-input {
    flex-grow: 3;
    padding: 0rem 0.2rem;
    box-sizing: border-box;
}

.nav-box>.nav-input>input[type="text"] {
    box-sizing: border-box;
    width: 100%;
    padding: 0rem 0.1rem;
    height: 0.6rem;
    border: none;
    outline: none;
    background-image: url("../assets/search.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 0.4rem;
    background-color: #eeeeee;
    border-radius: 0.1rem;
}

.nav-box>.nav-input>input[type="text"]:focus {
    background-image: none;
    border: 1px solid #007bff;
}

.nav-box>.nav-btn {
    flex-grow: 1;
    text-align: center;
    color: #007bff;
    cursor: pointer;
    font-size: 0.36rem;
    /* display: none; */
}
</style>